//
//  UIViewController+LoginHold.m
//  BaseProject
//
//  Created by 王洋 on 2020/10/23.
//  Copyright © 2020 王洋. All rights reserved.
//
#import "V_LoginViewController.h"
#import "LoginViewController.h"
#import "UIViewController+LoginHold.h"

@implementation UIViewController (LoginHold)

- (void)openLoginWithCompletion:(TTOpenLoginCompletionBlock)completion{
    if ([TTUserModel sharedObject].token.length > 0) {
        completion(YES,@{});
        return;
    }
    
    V_LoginViewController* login = [[V_LoginViewController alloc] init];
    //LoginViewController* login = [[LoginViewController alloc] init];
    login.completion = completion;
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:login];
    nav.navigationBar.translucent = NO;
    nav.modalPresentationStyle = UIModalPresentationFullScreen;
    UIViewController *spVc = self.navigationController? self.navigationController: self;
    [spVc presentViewController:nav animated:YES completion:nil];
}

@end
